import {
    WebGLRenderer,
    Scene,
    PerspectiveCamera,
    BoxGeometry,
    MeshPhongMaterial,
    Mesh,
    Object3D,
    PointLight,
    SphereBufferGeometry,
    DirectionalLight,
} from "three";

// 创建一个球体
const sphere=new SphereBufferGeometry(1,24,24)

// 创建太阳(网格单元)
const sunMaterial=new MeshPhongMaterial({emissive:0xffff00})
const sunMesh=new Mesh(sphere,sunMaterial)
sunMesh.scale.set(4,4,4)

// 创建地球(网格单元)
const earthMaterial=new MeshPhongMaterial({emissive:0x112244,color:0x223344})//放射光的颜色
const earthMesh=new Mesh(sphere,earthMaterial)

// 创建月亮(网格单元)
const moonMaterial=new MeshPhongMaterial({emissive:0x222222,color:0x888888})//放射光的颜色
const moonMesh=new Mesh(sphere,moonMaterial)
moonMesh.scale.set(0.5,0.5,0.5)

// 创建一个3D空间
export const moonOribit=new Object3D();
moonOribit.position.x=2
moonOribit.add(moonMesh)

// 创建一个3D空间
export const earthOribit=new Object3D();
earthOribit.position.x=15
earthOribit.add(earthMesh)
earthOribit.add(moonOribit)

// 创建一个3D空间
export const sunOribit=new Object3D();
sunOribit.add(sunMesh)
sunOribit.add(earthOribit)

// 创建一个点光源
export const pointLight=new PointLight(0xffffff,3)

